home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_pyr3smashout.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  290 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_pyr3smashout.cog
  4. #
  5. # an all-purpose cog for the IMP#1 effect
  6. #
  7. # [CMG] && [RKD]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. #    MESSAGES
  14. message     startup
  15. message     activated
  16. message        damaged
  17. message        pulse
  18.  
  19. #    ACTORS
  20. thing    player                                        local
  21.  
  22. # cameras
  23. thing    saycam
  24. thing    cam1spot    local
  25. thing    cam1look    local
  26.  
  27. # things
  28. thing   bombpos    
  29. thing    fragment                                local
  30. thing    dustthing                                local
  31.  
  32. # surfaces
  33. surface        crackedwall        mask=0x408
  34. surface        outerwall1        nolink
  35. surface        outerwall2        nolink
  36.  
  37. # sectors
  38. sector        noseesector        nolink        
  39.  
  40. # materials
  41. material    dustmat=gen_a4sfx_dustcloud.mat            local
  42.  
  43. # sound fx
  44. sound        explosion=shw_wall_crash.wav            local
  45. sound       sfxCharge=imp1_chargeup.wav             local
  46. sound        rumble=imp1_wall_break.wav                local
  47.  
  48. # voice lines
  49. sound       inCrumble=Inxj025.wav                   local   # ...ready to crumble.
  50. sound       inVibrate=Inxj026.wav                   local   # A little vibration...
  51.  
  52. # templates
  53. template    debris=stoneshrapa_nc                    local
  54. template    dust=dustcloud4ever                        local
  55.  
  56. # variables
  57. int            i=0                                           local
  58.  
  59. # subroutines
  60. flex        vibeline=0.0                            local
  61. flex        fauxdamage=0.0                            local
  62.  
  63. end
  64.  
  65. # ========================================================================================
  66. code
  67. startup:
  68.     Sleep(.01);
  69.     
  70.     # make walls no-move, no-see, and visible
  71.     ClearAdjoinFlags(crackedwall, 0x2);
  72.     ClearAdjoinFlags(crackedwall, 0x1);
  73.     SetFaceGeoMode(crackedwall, 4);
  74.  
  75.     ClearAdjoinFlags(outerwall1, 0x2);
  76.     ClearAdjoinFlags(outerwall1, 0x1);
  77.     SetFaceGeoMode(outerwall1, 4);
  78.  
  79.     ClearAdjoinFlags(outerwall2, 0x2);
  80.     ClearAdjoinFlags(outerwall2, 0x1);
  81.     SetFaceGeoMode(outerwall2, 4);
  82.  
  83.     SetSectorAdjoins(noseesector, 0);
  84.  
  85.     return;
  86.  
  87. # ========================================================================================
  88.  
  89. activated:
  90. # ---> crackedwall    
  91.     if (GetSenderRef() != crackedwall) return;
  92.     player = GetLocalPlayerThing();
  93.     
  94.     # FOR MARCUS TESTING PURPOSES
  95.     IF (INEDITOR())
  96.     {
  97.         CALL FAUXDAMAGE;
  98.         RETURN;
  99.     }
  100.  
  101.     if (GetCurWeapon(player) == 14)
  102.     {
  103.         call fauxdamage;
  104.         return;
  105.     }
  106.  
  107.     call vibeLine;
  108.  
  109.     return;
  110.     
  111. # ========================================================================================
  112. damaged:
  113. # ---> crackedwall    
  114.  
  115.     # if not damaged with IMP1 return
  116.     if (GetParam(1) != 0x1000) return;
  117.     player = GetLocalPlayerThing();
  118.  
  119. fauxdamage:
  120. # ---> shortcut to get around "activation with IMP#1"
  121.  
  122.     # prepare player
  123.     if (MakeMeStop() == -1) return;
  124.  
  125.     StartCutscene(1);
  126.  
  127.     # clear those adjoins aforehand
  128.     SetSectorAdjoins(noseesector, 1);
  129.  
  130.     # setup offset camera
  131.     cam1spot = CreateThing(GetThingTemplate(saycam), saycam);
  132.     cam1look = CreateThing(GetThingTemplate(saycam), saycam);
  133.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  134.     SetCameraLookInterp(2, 0);
  135.     SetCameraPosInterp(2, 0);
  136.     SetCameraFocus(2, cam1spot);
  137.     SetCameraSecondaryFocus(2, cam1look);
  138.     SetCurrentCamera(2);
  139.     ResetCameraFOV(0, 0.0);
  140.     SetCameraLookInterp(2, 1);
  141.     SetCameraPosInterp(2, 1);
  142.     SetCameraInterpSpeed(2, 0.7);
  143.     Sleep(0.01);
  144.     SetCameraFocus(2, saycam);
  145.     SetCameraSecondaryFocus(2, bombpos);
  146.  
  147.     # start cameraShake
  148.     SetPulse(0.05);
  149.  
  150.     # alter fov for zoom-in effect
  151.     SetCameraFOV(70, 1, 2.5);
  152.  
  153.     # play sfx
  154.     PlaySoundLocal(sfxCharge, 1.0, 0.0, 0x0, 0);
  155.  
  156.     # light up the player
  157.     SetThingLight(bombpos, '0.25 0.55 1.0', 5.0, 2.0);
  158.     Sleep(1.5);
  159.     
  160.     # start up the rumble sound
  161.     PlaySoundLocal(rumble, 1.0, 0.0, 0x0, 0);
  162.     Sleep(1);
  163.  
  164.     # reset fov
  165.     SetCameraFOV(90, 0, 0.0);
  166.  
  167.     # kill dynamic light
  168.     SetThingLight(bombpos, '0.0 0.0 0.0', 5.0, 2.0);
  169.  
  170.     # play explosion sfx
  171.     PlaySoundLocal(explosion, 1, 0, 0x0, 0);
  172.  
  173.     # create the debris
  174.     for(i=0; i<8; i=i+1)                                                            
  175.     {
  176.         fragment = CreateThing(debris, bombpos);
  177.         SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.1 0.0'), 1));
  178.         SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 200.0));
  179.         Sleep(0.025);
  180.     }
  181.         
  182.     # make walls traversible, see-through, and invisible
  183.     SetAdjoinFlags(crackedwall, 0x2);
  184.     SetAdjoinFlags(crackedwall, 0x1);
  185.     SetFaceGeoMode(crackedwall, 0);
  186.     
  187.     SetAdjoinFlags(outerwall1, 0x2);
  188.     SetAdjoinFlags(outerwall1, 0x1);
  189.     SetFaceGeoMode(outerwall1, 0);
  190.  
  191.     SetAdjoinFlags(outerwall2, 0x2);
  192.     SetAdjoinFlags(outerwall2, 0x1);
  193.     SetFaceGeoMode(outerwall2, 0);
  194.  
  195.     # stop the screenshake
  196.     SetPulse(0);
  197.  
  198.     # create and animate the dust sprites
  199.     SetMaterialCel(dustmat, 0);
  200.     MaterialAnim(dustmat, 1.0, 1);
  201.     dustthing = CreateThing(dust, bombpos);
  202.     AnimateSpriteSize(dustthing, '0.2 0.2 0.5', '0.6 0.6 0.0', 4.0);
  203.     sleep(.3);
  204.     dustthing = CreateThing(dust, bombpos);
  205.     AnimateSpriteSize(dustthing, '0.2 0.2 0.5', '0.6 0.6 0.0', 4.0);
  206.     
  207.     # rest for a bit
  208.     Sleep(0.5);
  209.  
  210.     # restore camera and get rid of objects
  211.     SetCameraLookInterp(2, 0);
  212.     SetCameraPosInterp(2, 0);
  213.     SetCameraPosition(1, GetThingPos(saycam));
  214.     SetCurrentCamera(1);
  215.     DestroyThing(cam1spot);
  216.     DestroyThing(cam1look);
  217.  
  218.     # restore controls
  219.     RestoreExtCam();
  220.     EndCutscene();
  221.     ClearActorFlags(player, 0x200000);
  222.  
  223.     return;
  224.  
  225. # ========================================================================================
  226. vibeLine:
  227.     # prepare the player
  228.     if (MakeMeStop() == -1) return;
  229.     DeselectWeaponWait(player);
  230.  
  231.     StartCutscene(0);
  232.     
  233.     # setup offset camera
  234.     cam1spot = CreateThing(GetThingTemplate(saycam), saycam);
  235.     cam1look = CreateThing(GetThingTemplate(saycam), saycam);
  236.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  237.     SetCameraLookInterp(2, 0);
  238.     SetCameraPosInterp(2, 0);
  239.     SetCameraFocus(2, cam1spot);
  240.     SetCameraSecondaryFocus(2, cam1look);
  241.     SetCurrentCamera(2);
  242.     ResetCameraFOV(0, 0.0);
  243.     SetCameraLookInterp(2, 1);
  244.     SetCameraPosInterp(2, 1);
  245.     SetCameraInterpSpeed(2, 0.7);
  246.     Sleep(0.01);
  247.     SetCameraFocus(2, saycam);
  248.     SetCameraSecondaryFocus(2, bombpos);
  249.  
  250.     # say line shifts with every activation
  251.     Sleep(0.3);
  252.     if (i == 0)
  253.     {
  254.         PlayVoice(player, inVibrate, 1.0, 1);
  255.     }
  256.     else
  257.     {
  258.         PlayVoice(player, inCrumble, 1.0, 1);
  259.     }
  260.  
  261.     i = 1 - i;
  262.  
  263.     # restore camera and get rid of objects
  264.     SetCameraLookInterp(2, 0);
  265.     SetCameraPosInterp(2, 0);
  266.     SetCameraPosition(1, GetThingPos(saycam));
  267.     SetCurrentCamera(1);
  268.     ResetCameraFOV(0, 0.0);
  269.     DestroyThing(cam1spot);
  270.     DestroyThing(cam1look);
  271.  
  272.     EndCutscene();
  273.     ClearActorFlags(player, 0x200000);
  274.  
  275.     return;
  276.  
  277. # ========================================================================================
  278. pulse:
  279.     SetPOVShake('0.0 0.0 0.001', '0.0 0.0 0.0', 80.0, 0.80);
  280.     return;
  281.  
  282. # ========================================================================================
  283.  
  284.  
  285. end
  286.  
  287.  
  288.  
  289.  
  290.